
function xy(a_x, a_y) {
	this.x = a_x;
	this.y = a_y;
};

//arrX,arrY are set by York at creation
// This is the place that the tile is in the array of the level data
//
//x,y are set by York at creation
// This is based off of the arrX and arrY
// They are the location of the center of the tile on the map itself
//
//drawID is received from the graphics engine
// This is the current texture it uses when drawing
//
//type is set by York at creation
// This contains the information it needs to send to the graphcis engine to
// get the proper drawID.
//
//tower is set to null at creation
// This is the reference to the tower that has been placed on this tile. When 
// a tower is removed this value is set back to null.
//
// The idea behind towertiles is that they draw their own ("grass.png")
// texture no matter what. If the tower value is not set to null, it is passed
// along to the graphics engine second to be drawn after the towertile so that
// it overlaps the towertiles texture.
function TowerTile(a_arrX,a_arrY,a_x,a_y,a_drawID,a_type,a_tower) {
	this.arrX = a_arrX;
	this.arrY = a_arrY;
	this.x = a_x;
	this.y = a_y;
	this.drawID = a_drawID;
	this.type = a_type;
	this.tower = a_tower;	
}


//arrX,arrY are set by York at creation
// This is the place that the tile is in the array of the level data
//
//x,y are set by York at creation
// This is based off of the arrX and arrY
// They are the location of the center of the tile on the map itself
//
//drawID is received from the graphics engine
// This is the current texture it uses when drawing
//
//type is set by York at creation
// This contains the information it needs to send to the graphcis engine to
// get the proper drawID.
//
//next is an xy object set at map creation
// This value can be a single x,y coordinate, or an array of up to 3 x,y
// coordinates. All the logic for this is done in this function and the only 
// interactions creeps need to have with the path is to call its current
// destinations getNext() function when it reaches the same x,y.
//
//getNext() returns an xy object containing the x,y of the next location that the creep should be
// moving towards
function PathTile(a_arrX,a_arrY,a_x,a_y,a_drawID,a_type,a_next) {
	this.arrX = a_arrX;
	this.arrY = a_arrY;
	this.x = a_x;
	this.y = a_y;
	this.drawID = a_drawID;
	this.type = a_type;
	if(a_next instanceof Array != true) {
		this.next = a_next;
		this.getNext = function (){
			if(this.type != "End") {
				return this.next;
			}
			return null;
		}
	}
	else {
		this.next = a_next.slice();
		this.compass = 0;
		this.getNext = function (){
			if(this.type != "End") {
				if(this.next[this.compass + 1] != null)
					this.compass += 1;
				else this.compass = 0;
				return this.next[compass];
			}
			return null;
		}
	}
}